module.exports = function($scope, $state,code,$modalInstance,flag,$resource,toaster, $http, $q){ 
  var code = flag ? {'flag': true} : code;
  $scope.objs = {};
    
    $resource('/api/as/ggc/facediscerndao/getFDareaDetailBycodesp', {}, {}).save({'code':code},function (res) {
      if (res.errcode !== 0) {
        // alert("数据获取失败");
        return;
      }
      $scope.objs = res.data;
    });


$scope.pass =function(code) {
  $resource('/api/as/ggc/facediscerndao/updateFDpass', {}, {}).save($scope.objs,function (res) {
    if (res.errcode !== 0) {
      alert(res.errmsg);
      return;
    }else{
      toaster.success({ title: "提示", body: "审批通过!"});
      $modalInstance.close();
      // $scope.goback();
    }
  });
};

$scope.nopass =function(code) {
  $resource('/api/as/ggc/facediscerndao/updateFDnopass', {}, {}).save($scope.objs,function (res) {
    if (res.errcode !== 0) {
      alert(res.errmsg);
      return;
    }else{
      toaster.success({ title: "提示", body: "驳回成功!"});
      $modalInstance.close();
      // $scope.goback();
    }
  });
};

};